<?php

class Base_Controller
{

    protected $view;
    protected $model;

    function __construct() {
        $this->model = new Model(ROOT . DS . 'models');
        Twig_Autoloader::register();
        $loader = new Twig_Loader_Filesystem(VIEWS);
        $this->view = new Twig_Environment($loader);
    }

    function renderTpl($tpl, array $data = array()) {
        $data['layout'] = $tpl;
        $_tpl = $this->view->loadTemplate('template.php');
        $_tpl->display($data);
    }

}